
<%@ Page Language="C#" Theme="Default" MasterPageFile="~/site.master" AutoEventWireup="true"  CodeFile="Dokument.aspx.cs" Inherits="Dokument" Title="Dokument List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Dokument List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" Visible="true" />
		<br />
		<data:EntityGridView ID="GridView1" runat="server"			
			AutoGenerateColumns="False"					
			OnSelectedIndexChanged="GridView_SelectedIndexChanged"
			DataSourceID="DokumentDataSource"
			DataKeyNames="Id"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_Dokument.xls"  		
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />				
				<asp:TemplateField HeaderText="Id Dokument Tip">
				<ItemTemplate>
						<asp:Repeater ID="Id1" runat="server" DataSourceID="DokumentTipFilter1">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="DokumentTipFilter1" runat="server"
							DataSourceID="DokumentTipDataSource1"
							Filter='<%# String.Format("Id = {0}", Eval("IdDokumentTip")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:BoundField DataField="Oznaka" HeaderText="Oznaka" SortExpression="Oznaka"  />
				<asp:BoundField DataField="Datum" HeaderText="Datum" SortExpression="Datum"  />
				<asp:BoundField DataField="Napomena" HeaderText="Napomena" SortExpression="Napomena"  />
				<asp:BoundField DataField="Napomena2" HeaderText="Napomena2" SortExpression="Napomena2"  />
				<asp:TemplateField HeaderText="Id Klijent">
				<ItemTemplate>
						<asp:Repeater ID="Id2" runat="server" DataSourceID="KlijentFilter2">
							<ItemTemplate>
								<%# Eval("ImeKlijenta") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="KlijentFilter2" runat="server"
							DataSourceID="KlijentDataSource2"
							Filter='<%# String.Format("Id = {0}", Eval("IdKlijent")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:TemplateField HeaderText="Id Organizacija Od">
				<ItemTemplate>
						<asp:Repeater ID="Id3" runat="server" DataSourceID="OrganizacijaFilter3">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="OrganizacijaFilter3" runat="server"
							DataSourceID="OrganizacijaDataSource3"
							Filter='<%# String.Format("Id = {0}", Eval("IdOrganizacijaOd")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:TemplateField HeaderText="Id Organizacija Prema">
				<ItemTemplate>
						<asp:Repeater ID="Id4" runat="server" DataSourceID="OrganizacijaFilter4">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="OrganizacijaFilter4" runat="server"
							DataSourceID="OrganizacijaDataSource4"
							Filter='<%# String.Format("Id = {0}", Eval("IdOrganizacijaPrema")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:TemplateField HeaderText="Id Nacin Transporta">
				<ItemTemplate>
						<asp:Repeater ID="Id5" runat="server" DataSourceID="NacinTransportaFilter5">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="NacinTransportaFilter5" runat="server"
							DataSourceID="NacinTransportaDataSource5"
							Filter='<%# String.Format("Id = {0}", Eval("IdNacinTransporta")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:TemplateField HeaderText="Id Nacin Placanja">
				<ItemTemplate>
						<asp:Repeater ID="Id6" runat="server" DataSourceID="NacinPlacanjaFilter6">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="NacinPlacanjaFilter6" runat="server"
							DataSourceID="NacinPlacanjaDataSource6"
							Filter='<%# String.Format("Id = {0}", Eval("IdNacinPlacanja")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:BoundField DataField="IdUserCreated" HeaderText="Id User Created" SortExpression="IDUserCreated"  />
				<asp:BoundField DataField="IdUserModified" HeaderText="Id User Modified" SortExpression="IDUserModified"  />
				<asp:BoundField DataField="DateCreated" HeaderText="Date Created" SortExpression="DateCreated"  />
				<asp:BoundField DataField="DateModified" HeaderText="Date Modified" SortExpression="DateModified"  />
				<asp:TemplateField HeaderText="Id User Izdao">
				<ItemTemplate>
						<asp:Repeater ID="Id7" runat="server" DataSourceID="DjelatnikFilter7">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="DjelatnikFilter7" runat="server"
							DataSourceID="DjelatnikDataSource7"
							Filter='<%# String.Format("Id = {0}", Eval("IdUserIzdao")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:TemplateField HeaderText="Id User Primio">
				<ItemTemplate>
						<asp:Repeater ID="Id8" runat="server" DataSourceID="DjelatnikFilter8">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="DjelatnikFilter8" runat="server"
							DataSourceID="DjelatnikDataSource8"
							Filter='<%# String.Format("Id = {0}", Eval("IdUserPrimio")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:BoundField DataField="RedBr" HeaderText="Red Br" SortExpression="RedBr"  />
				<asp:BoundField DataField="NabavnaVrijednost" HeaderText="Nabavna Vrijednost" SortExpression="NabavnaVrijednost"  />
			</Columns>
			<EmptyDataTemplate>
				<b>No Dokument Found!</b>
			</EmptyDataTemplate>
		</data:EntityGridView>
		<br />
		<asp:Button runat="server" ID="btnDokument" OnClientClick="javascript:location.href='/NetROS.Tiers.website/admin/DokumentEdit.aspx'; return false;" Text="Add New"></asp:Button>
			
		<data:DokumentTipDataSource ID="DokumentTipDataSource1" runat="server"
			SelectMethod="GetAll"
		/>

		<data:KlijentDataSource ID="KlijentDataSource2" runat="server"
			SelectMethod="GetAll"
		/>

		<data:OrganizacijaDataSource ID="OrganizacijaDataSource3" runat="server"
			SelectMethod="GetAll"
		/>

		<data:OrganizacijaDataSource ID="OrganizacijaDataSource4" runat="server"
			SelectMethod="GetAll"
		/>

		<data:NacinTransportaDataSource ID="NacinTransportaDataSource5" runat="server"
			SelectMethod="GetAll"
		/>

		<data:NacinPlacanjaDataSource ID="NacinPlacanjaDataSource6" runat="server"
			SelectMethod="GetAll"
		/>

		<data:DjelatnikDataSource ID="DjelatnikDataSource7" runat="server"
			SelectMethod="GetAll"
		/>

		<data:DjelatnikDataSource ID="DjelatnikDataSource8" runat="server"
			SelectMethod="GetAll"
		/>

		<data:DokumentDataSource ID="DokumentDataSource" runat="server"
			SelectMethod="GetPaged"
			EnablePaging="True"
			EnableSorting="True"
		>
			<Parameters>
				<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
				<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" />
				<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" />
				<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
			</Parameters>
		</data:DokumentDataSource>
	    		
</asp:Content>



